package com.cskaoyan.controller.admin.authcontroller;

import com.cskaoyan.vo.BaseRespVo;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionControllerAdvise {


    @ExceptionHandler(AuthorizationException.class)
    @ResponseBody


    public BaseRespVo handlerAuthorException(Exception e){
        return BaseRespVo.fail506("无操作权限");
//        return "noperm"; //ModelAndView
    }
//    @ExceptionHandler(AuthenticationException.class)
//    public String handlerAuthenticationException(AuthenticationException e){
//        return "/#/login";
//    }
}
